﻿using System;

class findPrimeNumber
{
    public static void Main(string[] args)
    {
        bool[] isPrime = new bool[101];
        
        isPrime[0] = false;
        isPrime[1] = false;
        for(int n = 2;n<isPrime.Length;n++)
        {
            isPrime[n] = true;
        }
       
        Console.WriteLine("2-100中的素数有：");
        findPrime(ref isPrime, 2);
        for (int i = 2; i < isPrime.Length; i++)
        {
            if (isPrime[i])
            {
                Console.Write(i+" ");

            }
        }
    }
   
    public static void findPrime(ref bool[] isPrime,int number)
    {
        if(number>=100) { return; }
        if (isPrime[number] ) { 
            for(int i = 2 * number; i <= 100; i += number)
            {
                isPrime[i] = false;
            }
        }
        findPrime(ref isPrime, number+1);
     
    }
}